home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Freeware / Remapollo / Modules / FixRamlib.s < prev    next >
Text File  |  2002-10-27  |  1KB  |  60 lines

  1.  
  2. * FixRamlib patch module for RemAPollo
  3. * fixes problems with ramlib module on KS 2x
  4. * (data registers trashing on init time)
  5.  
  6. * must be applied if you want to use external RT_AFTERDOS resident modules
  7. * on KS2x
  8.  
  9. * based on BlizKick [(c) Harry Sintonen] interface
  10. * Public Domain
  11. * coded by MM in 2000
  12.  
  13.  
  14.     moveq    #'z',d0            ;BKMODULE_ID
  15.     rts
  16.  
  17.     dc.l    $4e71            ;BKEP_ID
  18.  
  19.     moveq    #0,d7
  20.     move.l    a1,-(sp)
  21.     lea    (_name,pc),a1        ; _FindResident
  22.     jsr    (a2)
  23.     move.l    (sp)+,a1
  24.     tst.l    d0
  25.     beq    .exit
  26.     move.l    d0,a2
  27.  
  28.     move.b    (11,a2),d0
  29.     cmpi.b    #36,d0
  30.     bcs    .exit
  31.     cmpi.b    #39,d0
  32.     bcc    .exit
  33.  
  34.     move.l    ($16,a2),d0        ;init
  35.     sub.l    a1,d0
  36.     adda.l    d0,a0
  37.  
  38.     cmpi.l    #$48e70034,(a0)+
  39.     bne    .out
  40.     move.b    #$38,(-2,a0)        ;fix starting movem
  41. .find    cmpi.w    #$4e75,(a0)+
  42.     bne    .find
  43.     cmpi.l    #$4cdf2c00,(-6,a0)
  44.     bne    .out
  45.     move.b    #$1c,(-3,a0)        ;fix ending movem
  46.     
  47.     moveq    #1,d7
  48. .out    move.l    d7,d0
  49.     rts
  50.  
  51. .exit    lea    (_error1,pc),a0        ; a0=fmt
  52.     suba.l    a1,a1
  53.     jsr    (a4)            ; Call _Printf
  54.     bra    .out
  55.  
  56. _name    dc.b    'ramlib',0
  57.  
  58. _error1    dc.b    'FixRamlib: This patch requires Kickstart 2x!',10,0
  59.     dc.b    '$VER: FixRamlib_PATCH 1.0 (14.5.2000)',13,10,0
  60.